package com.ticket.sass.common.file.factory;


import com.ticket.sass.common.file.context.SpringContextHolder;
import com.ticket.sass.common.file.service.FileService;

/**
 * 获取文件服务类的工厂
 */
public class FileServiceFactory
{

    private static final String SERVICE_NNME="qnFileService";

    /**
     * 根据bean名字获取实现
     * @param serviceName
     * @return
     */
    public static FileService getFileService(String serviceName)
    {
        return SpringContextHolder.<FileService>getBean(serviceName);
    }

    /**
     * 默认返回七牛云实现
     * @return
     */
    public static FileService getFileService()
    {
        return SpringContextHolder.<FileService>getBean(SERVICE_NNME);
    }

}
